package Controllers;

import Models.*;
import java.util.ArrayList;
import java.util.Date;

/**
 * @author Thomas
 */
public class ItemCTR {

    private ItemCollection stock;

    public ItemCTR()
    {
        this.stock = ItemCollection.getInstance();
    }

    public Item addItem(String name, String description, String manufacturer, Supplier supplier, Double price, Location location, int minimumStock, int maximumStock)
    {
        Item newItem = new Item(name, description, manufacturer, supplier, price, location, minimumStock, maximumStock);
        this.stock.addItem(newItem);
        return newItem;
    }

    public ArrayList<Item> findItem(String name, String description, String manufacturer, Supplier supplier, Double price, Date acquisitionDate, Location location, int minimumStock, int maximumStock)
    {
        return this.stock.findItem(name, description, manufacturer, supplier, price, acquisitionDate, location, minimumStock, maximumStock);
    }

    public ArrayList<Item> getAllItems()
    {
        return stock.getAllItems();
    }

    public Item getItem(int itemNo)
    {
        return this.stock.getItem(itemNo);
    }

    public void removeItem(Item item)
    {
        this.stock.removeItem(item);
    }
}

